<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorate="~{layout/default}">
<head>
    <title>客户详情</title>
</head>
<body>
    <div layout:fragment="content">
        <div class="d-flex justify-content-between align-items-center mb-3">
            <h1>客户详情</h1>
            <div>
                <a th:href="@{/customer/edit/{id}(id=${customer.id})}" class="btn btn-primary">编辑</a>
                <a th:href="@{/customer/list}" class="btn btn-secondary ml-2">返回列表</a>
            </div>
        </div>
        
        <div class="card">
            <div class="card-body">
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>客户名称</label>
                            <p class="form-control-static" th:text="${customer.name}">-</p>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>联系电话</label>
                            <p class="form-control-static" th:text="${customer.phone}">-</p>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>电子邮箱</label>
                            <p class="form-control-static" th:text="${customer.email}">-</p>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>地址</label>
                            <p class="form-control-static" th:text="${customer.address}">-</p>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>客户状态</label>
                            <p class="form-control-static">
                                <span th:if="${customer.status == 0}" class="badge badge-warning">潜在客户</span>
                                <span th:if="${customer.status == 1}" class="badge badge-success">正式客户</span>
                                <span th:if="${customer.status == 2}" class="badge badge-secondary">流失客户</span>
                            </p>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>客户等级</label>
                            <p class="form-control-static">
                                <span th:text="${'⭐'.repeat(customer.level)}">-</span>
                            </p>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>客户来源</label>
                            <p class="form-control-static" th:text="${customer.source}">-</p>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>客户类别</label>
                            <p class="form-control-static" th:text="${customer.categoryName}">-</p>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>所属行业</label>
                            <p class="form-control-static" th:text="${customer.industry}">-</p>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>企业规模</label>
                            <p class="form-control-static" th:text="${customer.scale}">-</p>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>年营业额</label>
                            <p class="form-control-static" th:text="${customer.annualRevenue}">-</p>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>网站</label>
                            <p class="form-control-static">
                                <a th:if="${customer.website}" th:href="${customer.website}" target="_blank" th:text="${customer.website}">-</a>
                                <span th:unless="${customer.website}">-</span>
                            </p>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>创建时间</label>
                            <p class="form-control-static" th:text="${#temporals.format(customer.createTime, 'yyyy-MM-dd HH:mm:ss')}">-</p>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>最后更新时间</label>
                            <p class="form-control-static" th:text="${#temporals.format(customer.updateTime, 'yyyy-MM-dd HH:mm:ss')}">-</p>
                        </div>
                    </div>
                    <div class="col-md-12">
                        <div class="form-group">
                            <label>备注</label>
                            <p class="form-control-static" th:text="${customer.remarks}">-</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html> 